﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Xml;
using System.Drawing.Design;

namespace SPVisualDev.VSAddin.Dialogs.PropertySheets
{
    internal class PropSheetFeatureInfo : PropSheetBase
    {
        public PropSheetFeatureInfo(string DefaultResourceFile, EnvDTE.ProjectItem ParentFeatureFolder, XmlElement ElementXml)
        {
            this.DefaultResourceFile = DefaultResourceFile;
            this.ParentFeatureFolder = ParentFeatureFolder;

            this.Title = new ResourceStringContainer(string.Empty, DefaultResourceFile, ParentFeatureFolder);
            this.Description = new ResourceStringContainer(string.Empty, DefaultResourceFile, ParentFeatureFolder);

            if (ElementXml != null)
                this.PropXmlNode = ElementXml;
        }

        [CategoryAttribute("Properties"), DescriptionAttribute("Title"), RefreshProperties(RefreshProperties.None), TypeConverter(typeof(ResourceExpandableObjectConverter))]
        public ResourceStringContainer Title
        {
            get;
            set;
        }

        [CategoryAttribute("Properties"), DescriptionAttribute("Description"), RefreshProperties(RefreshProperties.None), TypeConverter(typeof(ResourceExpandableObjectConverter))]
        public ResourceStringContainer Description
        {
            get;
            set;
        }

        [CategoryAttribute("Main info"), DescriptionAttribute("Version"), RefreshProperties(RefreshProperties.None)]
        public string Version
        {
            get;
            set;
        }

        [CategoryAttribute("Main info"), DescriptionAttribute("Scope"), RefreshProperties(RefreshProperties.None)]
        public FeatureScopeEnum Scope
        {
            get;
            set;
        }

        [CategoryAttribute("Main info"), DescriptionAttribute("Hidden feature"), RefreshProperties(RefreshProperties.None)]
        public bool? Hidden
        {
            get;
            set;
        }

        [CategoryAttribute("Main info"), Browsable(true), Description("Receiver class"), ReadOnly(false), Editor(typeof(EventClassSelector), typeof(UITypeEditor))]
        public string ReceiverClass
        {
            get;
            set;
        }

        [CategoryAttribute("Main info"), Browsable(true), DescriptionAttribute("Receiver assembly name"), ReadOnly(false)]
        public string ReceiverAssembly
        {
            get;
            set;
        }

        [Browsable(false)]
        public override string ElementFileName
        {
            get
            {
                return base.ElementFileName;
            }
            set
            {
                base.ElementFileName = value;
            }
        }
    }

}
